package edu.zjut.hjg.saas.biz.service.impl;

import java.util.Date;

import edu.zjut.hjg.saas.biz.dao.ConsumptionDao;
import edu.zjut.hjg.saas.biz.model.Consumption;
import edu.zjut.hjg.saas.biz.service.ConsumptionService;
import edu.zjut.hjg.saas.biz.support.Paginated;

public class ConsumptionServiceImpl implements ConsumptionService {

    private ConsumptionDao consumptionDao;

    public void setConsumptionDao(ConsumptionDao consumptionDao) {
        this.consumptionDao = consumptionDao;
    }

    @Override
    public Paginated<Consumption> listByTenantId(Integer tenantId, int pageSize, int page) {
        return consumptionDao.listByTenantId(tenantId, pageSize, page);
    }

    @Override
    public Integer create(Consumption consumption) {
        return consumptionDao.create(consumption);
    }

    @Override
    public Paginated<Consumption> listByDateRang(Date fromDate, Date toDate, int pageSize, int page) {
        return consumptionDao.listByDateRang(fromDate, toDate, pageSize, page);
    }
}
